﻿namespace WMS6.Web.CrossDock
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class OpportAllocationQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnNew;
        protected Button btnSearch;
        protected DropDownList ddlAreaDescrOper;
        protected DropDownList ddlAreaIDOper;
        protected HtmlForm F2160;
        protected HtmlInputHidden hdnActionID;
        protected HtmlHead Head1;
        protected Label lblArea;
        protected Label lblAreaDescr;
        protected Label lblAreaID;
        protected HtmlLink mycss;
        protected ScriptManager ScriptManager1;
        protected TextBox txtAreaDescr;
        protected TextBox txtAreaID;

        protected void btnList_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("OpportAllocationList.aspx?action={0}&from=list", this.hdnActionID.Value.Trim()), false);
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer(string.Format("OpportAllocationList.aspx?action={0}", this.hdnActionID.Value.Trim()), false);
        }

        private void InitDropDownLists()
        {
            base.InitQueryDDL(this.ddlAreaIDOper, 0);
            base.InitQueryDDL(this.ddlAreaDescrOper, 0);
        }

        private void LoadData()
        {
            if (!string.IsNullOrEmpty(base.Request.QueryString["action"]))
            {
                this.btnNew.Visible = false;
                this.btnExport.Visible = false;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadData();
                this.InitDropDownLists();
            }
        }
    }
}

